package cn.theten52.demo.patterns.design.creation.builder;

import java.util.ArrayList;
import java.util.List;

/**
 * 车辆类
 *
 * @author wangjin
 * @date 2020/12/29
 */
public class Vehicle {

    private List<Wheel> wheels = new ArrayList<>();
    private List<Light> lights = new ArrayList<>();

    public List<Wheel> getWheels() {
        return wheels;
    }

    public Vehicle addWheels(String wheelName) {
        this.wheels.add(new Wheel(wheelName));
        return this;
    }

    public List<Light> getLights() {
        return lights;
    }

    public Vehicle addLights(String lightName) {
        this.lights.add(new Light(lightName));
        return this;
    }
}
